package com.easy.query.test.entity.base.proxy;

import com.easy.query.core.expression.parser.core.available.TableAvailable;
import com.easy.query.core.proxy.AbstractProxyEntity;
import com.easy.query.core.proxy.SQLColumn;
import com.easy.query.core.proxy.SQLSelectAsExpression;
import com.easy.query.core.proxy.fetcher.AbstractFetcher;
import com.easy.query.core.proxy.core.EntitySQLContext;
import com.easy.query.test.entity.base.City;
import com.easy.query.core.proxy.columns.types.SQLStringTypeColumn;
import com.easy.query.core.proxy.columns.SQLNavigateColumn;
import com.easy.query.core.proxy.columns.SQLManyQueryable;
import com.easy.query.core.proxy.columns.types.SQLAnyTypeColumn;

/**
 * this file automatically generated by easy-query, don't modify it
 * 当前文件是easy-query自动生成的请不要随意修改
 * 如果出现属性冲突请使用@ProxyProperty进行重命名
 *
 * @author easy-query
 */
public class CityProxy extends AbstractProxyEntity<CityProxy, City> {

    private static final Class<City> entityClass = City.class;

    public static final CityProxy TABLE = createTable().createEmpty();

    public static CityProxy createTable() {
        return new CityProxy();
    }

    public CityProxy() {
    }

    /**
     * {@link City#getCode}
     */
    public SQLStringTypeColumn<CityProxy> code() {
        return getStringTypeColumn("code");
    }

    /**
     * {@link City#getProvinceCode}
     */
    public SQLStringTypeColumn<CityProxy> provinceCode() {
        return getStringTypeColumn("provinceCode");
    }

    /**
     * {@link City#getName}
     */
    public SQLStringTypeColumn<CityProxy> name() {
        return getStringTypeColumn("name");
    }

    /**
     * {@link City#getAreas}
     */
    public SQLManyQueryable<CityProxy, com.easy.query.test.entity.base.proxy.AreaProxy, com.easy.query.test.entity.base.Area> areas() {
        return getNavigateMany("areas", new com.easy.query.test.entity.base.proxy.AreaProxy());
    }


    @Override
    public Class<City> getEntityClass() {
        return entityClass;
    }


    /**
     * 数据库列的简单获取
     *
     * @return
     */
    public CityProxyFetcher FETCHER = new CityProxyFetcher(this, null, SQLSelectAsExpression.empty);


    public static class CityProxyFetcher extends AbstractFetcher<CityProxy, City, CityProxyFetcher> {

        public CityProxyFetcher(CityProxy proxy, CityProxyFetcher prev, SQLSelectAsExpression sqlSelectAsExpression) {
            super(proxy, prev, sqlSelectAsExpression);
        }


        /**
         * {@link City#getCode}
         */
        public CityProxyFetcher code() {
            return add(getProxy().code());
        }

        /**
         * {@link City#getProvinceCode}
         */
        public CityProxyFetcher provinceCode() {
            return add(getProxy().provinceCode());
        }

        /**
         * {@link City#getName}
         */
        public CityProxyFetcher name() {
            return add(getProxy().name());
        }


        @Override
        protected CityProxyFetcher createFetcher(CityProxy cp, AbstractFetcher<CityProxy, City, CityProxyFetcher> prev, SQLSelectAsExpression sqlSelectExpression) {
            return new CityProxyFetcher(cp, this, sqlSelectExpression);
        }
    }

}
